package com.aaa.medicine.service.impl;


import com.aaa.entity.PurchaseItem;
import com.aaa.medicine.dao.InventoryMapper;
import com.aaa.medicine.service.IInventoryService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;


@Service
public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, PurchaseItem> implements IInventoryService {
@Autowired
private InventoryMapper inventoryMapper;
    @Override
    public Result<List<PurchaseItem>> getAll4(String puchaseId) {
        QueryWrapper<PurchaseItem> wrapper = new QueryWrapper<>();
        if (StringUtils.hasText(puchaseId)){
            wrapper.eq("purchase_id",puchaseId);
        }
        List<PurchaseItem> a1=inventoryMapper.selectList(wrapper);
        return new Result(200,"详情成功",a1);
    }
}
